import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from "../views/MainView.vue";
import Welcome from "../views/WelcomeView.vue";
import Category from "../views/CategoryView.vue";
import Book from "../views/BookView.vue";
import Borrow from "../views/BorrowView.vue";
import Users from "../views/UserView.vue";
import Logs from "../views/LogsView.vue";

Vue.use(VueRouter)

const routes = [
  {
    path:'/login',
    name:'login',
    component: 'Login'
  },
    {
        path: '/',
        name: 'Main',
        component: Main,
        redirect: '/welcome',
        children: [
            {
                path: '/welcome',
                name: Welcome,
                component: Welcome
            },
            {
                path: '/category',
                name: 'Category',
                component: Category,
            }, {
                path: '/book',
                name: 'book',
                component: Book,
            }, {
                path: '/borrow',
                name: 'Borrow',
                component: Borrow,
            }, {
                path: '/users',
                name: 'Users',
                component: Users,
            }, {
                path: '/logs',
                name: 'Logs',
                component: Logs,
            }],
    }
]

const router = new VueRouter({
    routes
})

export default router
